//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>
package org.jpgolay.wi.availability;

import java.io.Serializable;

public class Availability
        implements Serializable {

    public Availability() {
    }

    public Availability(Integer id, Integer realEstateId, Integer customerId, String beginDate, String endDate, String option, String confirmed,
            String notes, String lastUpdate, String lastUser) {
        setId(id);
        setRealEstateId(realEstateId);
        setCustomerId(customerId);
        setBeginDate(beginDate);
        setEndDate(endDate);
        setOption(option);
        setConfirmed(confirmed);
        setNotes(notes);
        setLastUpdate(lastUpdate);
        setLastUser(lastUser);
    }

    public Availability(Availability otherData) {
        setId(otherData.getId());
        setRealEstateId(otherData.getRealEstateId());
        setCustomerId(otherData.getCustomerId());
        setBeginDate(otherData.getBeginDate());
        setEndDate(otherData.getEndDate());
        setOption(otherData.getOption());
        setConfirmed(otherData.getConfirmed());
        setNotes(otherData.getNotes());
        setLastUpdate(otherData.getLastUpdate());
        setLastUser(otherData.getLastUser());
    }

    public String getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(String beginDate) {
        this.beginDate = beginDate;
    }

    public String getConfirmed() {
        return confirmed;
    }

    public void setConfirmed(String confirmed) {
        this.confirmed = confirmed;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLastUpdate() {
        return lastUpdate;
    }

    public void setLastUpdate(String lastUpdate) {
        this.lastUpdate = lastUpdate;
    }

    public String getLastUser() {
        return lastUser;
    }

    public void setLastUser(String lastUser) {
        this.lastUser = lastUser;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public String getOption() {
        return option;
    }

    public void setOption(String option) {
        this.option = option;
    }

    public Integer getRealEstateId() {
        return realEstateId;
    }

    public void setRealEstateId(Integer realEstateId) {
        this.realEstateId = realEstateId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "realEstateId=" + getRealEstateId() + " " + "customerId=" + getCustomerId() + " " + "beginDate=" + getBeginDate() + " " + "endDate=" + getEndDate() + " " + "option=" + getOption() + " " + "confirmed=" + getConfirmed() + " " + "lastUpdate=" + getLastUpdate() + " " + "lastUser=" + getLastUser() + " " + "notes=" + getNotes());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Availability) {
            Availability lTest = (Availability) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (realEstateId == null) {
                lEquals = lEquals && lTest.realEstateId == null;
            } else {
                lEquals = lEquals && realEstateId.equals(lTest.realEstateId);
            }
            if (customerId == null) {
                lEquals = lEquals && lTest.customerId == null;
            } else {
                lEquals = lEquals && customerId.equals(lTest.customerId);
            }
            if (beginDate == null) {
                lEquals = lEquals && lTest.beginDate == null;
            } else {
                lEquals = lEquals && beginDate.equals(lTest.beginDate);
            }
            if (endDate == null) {
                lEquals = lEquals && lTest.endDate == null;
            } else {
                lEquals = lEquals && endDate.equals(lTest.endDate);
            }
            if (option == null) {
                lEquals = lEquals && lTest.option == null;
            } else {
                lEquals = lEquals && option.equals(lTest.option);
            }
            if (confirmed == null) {
                lEquals = lEquals && lTest.confirmed == null;
            } else {
                lEquals = lEquals && confirmed.equals(lTest.confirmed);
            }
            if (lastUpdate == null) {
                lEquals = lEquals && lTest.lastUpdate == null;
            } else {
                lEquals = lEquals && lastUpdate.equals(lTest.lastUpdate);
            }
            if (lastUser == null) {
                lEquals = lEquals && lTest.lastUser == null;
            } else {
                lEquals = lEquals && lastUser.equals(lTest.lastUser);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (realEstateId == null ? 0 : realEstateId.hashCode());
        result = 37 * result + (customerId == null ? 0 : customerId.hashCode());
        result = 37 * result + (beginDate == null ? 0 : beginDate.hashCode());
        result = 37 * result + (endDate == null ? 0 : endDate.hashCode());
        result = 37 * result + (option == null ? 0 : option.hashCode());
        result = 37 * result + (confirmed == null ? 0 : confirmed.hashCode());
        result = 37 * result + (lastUpdate == null ? 0 : lastUpdate.hashCode());
        result = 37 * result + (lastUser == null ? 0 : lastUser.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        return result;
    }
    private Integer id;
    private Integer realEstateId;
    private Integer customerId;
    private String beginDate;
    private String endDate;
    private String option;
    private String confirmed;
    private String notes;
    private String lastUpdate;
    private String lastUser;
}
